<div class="panel panel-default panel-intro">
    
    <div class="panel-heading">
        {:build_heading(null,FALSE)}
        <ul class="nav nav-tabs" data-field="status">
            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
            {foreach name="statusList" item="vo"}
            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
            {/foreach}
        </ul>
    </div>

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-edit="{:$auth->check('xykeep.course.order/edit')}"
                           data-operate-del="{:$auth->check('xykeep.course.order/del')}"
                           width="100%">
                    </table>
                </div>
            </div>
        </div>
    </div>

    <script id="customformtpl" type="text/html">
        <!--form表单必须添加form-commsearch这个类-->
        <form action="" class="form-commonsearch">
            <div style="border-radius:2px;margin-bottom:10px;background:#f7f7f7;padding:15px;">
                <div class="row">
                    <div class="col-xs-12 col-sm-2 col-md-3">
                        <div class="form-group">
                            <div class="col-sm-3 ctr">订单号</div>
                            <input class="operate" type="hidden" data-name="order_sn" value="="/>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" name="order_sn" placeholder="" value=""/>
                            </div>
                        </div>
                    </div>

                    <div class="col-xs-12 col-sm-2 col-md-3">
                        <div class="form-group">
                            <div class="col-sm-3 ctr">购买人昵称</div>
                            <input class="operate" type="hidden" data-name="user.nickname" value="="/>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" name="user.nickname" placeholder="" value=""/>
                            </div>
                        </div>
                    </div>

                    <div class="col-xs-12 col-sm-2 col-md-3">
                        <div class="form-group">
                            <div class="col-sm-3 ctr">门店名称</div>
                            <input class="operate" type="hidden" data-name="store.name" value="="/>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" name="store.name" placeholder="" value=""/>
                            </div>
                        </div>
                    </div>

                    <div class="col-xs-12 col-sm-2 col-md-3">
                        <div class="form-group">
                            <div class="col-sm-3 ctr">课程名称</div>
                            <input class="operate" type="hidden" data-name="name" value="="/>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" name="name" placeholder="" value=""/>
                            </div>
                        </div>
                    </div>
                    
                </div>
                <div class="row mt-15">
                    <div class="col-xs-12 col-sm-2 col-md-3">
                        <div class="form-group">
                            <div class="col-sm-3 ctr">教练姓名</div>
                            <input class="operate" type="hidden" data-name="coach.nickname" value="="/>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" name="coach.nickname" placeholder="" value=""/>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-xs-12 col-sm-3 col-md-3">
                        <div class="form-group">
                            <div class="col-sm-3 ctr">创建时间</div>
                            <input type="hidden" class="operate" data-name="createtime" value="RANGE"/>
                            <div class="col-sm-9">
                                <input type="text" class="form-control datetimerange" name="createtime" value=""/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row mt-15">
                    <div class="col-xs-12 col-sm-3 col-md-3">
                        <div class="col-sm-3 ctr"></div>
                        <div class="col-sm-9">
                            <input type="submit" class="btn btn-success" value="筛选" style="padding: 7px 30px;" />
                            <input type="reset" class="btn btn-primary" value="重置" style="padding: 7px 30px;margin-left: 20px;" />
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </script>

    <script type="text/html" id="itemtpl">
        <% if(i == 0){ %>
            <div class="order-head">
                <div class="col-sm-4 flex obr">
                    <span>课程</span>
                    <span style="margin-left: auto;">单价(元) / 节数</span>
                </div>
                <div class="col-sm-2 text-center obr">实付金额(元)</div>
                <div class="col-sm-2 obr">买家</div>
                <div class="col-sm-2 text-center obr">交易状态</div>
                <div class="col-sm-2 text-center">操作</div>
            </div>
        <% } %>
    
        <div class="col-sm-12 mt-15">
            <div class="item-top">
                <span>订单号：<%=item.order_sn%></span>
                <span style="margin-left:100px;">下单时间：<%=Moment(item.createtime*1000).format("YYYY-MM-DD HH:mm:ss")%></span>
                <span style="margin-left:100px;">服务时间：<%=item.date%> <%=item.service_start_time_text%>~<%=item.service_end_time_text%></span>
                <span style="margin-left:100px;">支付方式：<%=item.pay_type_text%></span>
                <% if(item.vip_discount!=='0.00'){ %>
                <span style="margin-left:100px;color:#ff3333;">课包抵扣：<%=item.vip_discount%></span>
                <% } %>
                <% if(item.coupon_discount!=='0.00'){ %>
                <span style="margin-left:100px;color:#ff3333;">优惠券抵扣：<%=item.coupon_discount%></span>
                <% } %>
            </div>
            <div class="item-content">
                <div class="col-sm-4 obr flex" style="padding: 15px;">
                    <div class="order_img ">
                        <a href="javascript:;"><img class="img-md img-center" src="<%=cdnurl(item.image)%>" alt="<%=item.name%>"></a>
                    </div>
                    <div style="margin-left: 10px;">
                        <p><%=item.name%></p>
                        <p><%=item.type_text%></p>
                    </div>
                    <div style="margin-left: auto;text-align: right;">
                        <div><%=item.price%></div>
                        <div><%=item.buy_num%>节</div>
                    </div>
                </div>
                <div class="col-sm-2 vhc obr flex">
                    <%=item.total_fee%>
                </div>

                <div class="col-sm-2 vhc obr flex">
                    <div class="col-sm-12" style="padding: 0;">
                        <%=item.user.nickname%>(ID:<%=item.user.id%>)<br/>
                        <%=item.user.mobile%><br/>
                        <%=item.seat_detail%>
                    </div>
                </div>

                <div class="col-sm-2 vhc obr flex">
                    <%=item.status_text%>
                </div>

                <div class="col-sm-2 vhc flex">
                    <a href="javascript:;" class="detail btn btn-xs btn-success" data-id="<%=item.id%>"><i class="fa fa-eye"></i> 详情</a>
                </div>
            </div>
        </div>
    </script>
    
    <style>
        .flex{display: flex;flex-wrap: wrap;}
        .mt-15{margin-top: 15px;}
        .ctr{text-align: right;line-height: 35px;font-weight: bold;}
        .vhc{padding: 15px;height: 100%;align-items: center;justify-content: center;}
        .order-head{background: #f7f7f7;padding: 0px 15px;width: 100%;font-weight: bold;margin-top: 5px;}
        .order-head div{padding: 15px;}
        .item-top{background: #f7f7f7;padding: 10px;width: 100%;border: 1px solid #e6e6e6;}
        .item-content{border: 1px solid #e6e6e6;border-top: none;}
        .obr{border-right: 1px solid #e6e6e6;}
        /*.fixed-table-toolbar{display: none;}*/
    </style>
</div>

